.class public Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter;
.super Landroid/widget/BaseAdapter;
.source "FavCarListAdapter.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter$ViewHolder;
    }
.end annotation


# static fields
.field private static final str:Ljava/lang/String; = "\u7ecf\u9500\u5546\u62a5\u4ef7\uff1a"


# instance fields
.field carSummary:Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;

.field private list:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;",
            ">;"
        }
    .end annotation
.end field

.field private mInflater:Landroid/view/LayoutInflater;


# direct methods
.method public constructor <init>(Ljava/util/ArrayList;Landroid/widget/ListView;Landroid/content/Context;)V
    .locals 1
    .parameter
    .parameter "listView"
    .parameter "context"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;",
            ">;",
            "Landroid/widget/ListView;",
            "Landroid/content/Context;",
            ")V"
        }
    .end annotation

    .prologue
    .line 38
    .local p1, list:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;>;"
    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    .line 39
    iput-object p1, p0, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter;->list:Ljava/util/ArrayList;

    .line 42
    invoke-static {p3}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    iput-object v0, p0, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter;->mInflater:Landroid/view/LayoutInflater;

    .line 43
    return-void
.end method


# virtual methods
.method public getCount()I
    .locals 1

    .prologue
    .line 47
    iget-object v0, p0, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter;->list:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 1
    .parameter "position"

    .prologue
    .line 52
    iget-object v0, p0, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter;->list:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    return-object v0
.end method

.method public getItemId(I)J
    .locals 2
    .parameter "position"

    .prologue
    .line 58
    const-wide/16 v0, 0x0

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 5
    .parameter "position"
    .parameter "convertView"
    .parameter "parent"

    .prologue
    .line 66
    if-nez p2, :cond_0

    .line 67
    iget-object v2, p0, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter;->mInflater:Landroid/view/LayoutInflater;

    const v3, 0x7f030005

    const/4 v4, 0x0

    invoke-virtual {v2, v3, v4}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p2

    .line 68
    new-instance v1, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter$ViewHolder;

    invoke-direct {v1, p0}, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter$ViewHolder;-><init>(Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter;)V

    .line 70
    .local v1, holder:Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter$ViewHolder;
    const/high16 v2, 0x7f0b

    invoke-virtual {p2, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    iput-object v2, v1, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter$ViewHolder;->name:Landroid/widget/TextView;

    .line 71
    const v2, 0x7f0b0003

    invoke-virtual {p2, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    iput-object v2, v1, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter$ViewHolder;->price:Landroid/widget/TextView;

    .line 73
    const v2, 0x7f0b0001

    invoke-virtual {p2, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/ImageView;

    .line 72
    iput-object v2, v1, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter$ViewHolder;->imageView:Landroid/widget/ImageView;

    .line 74
    const v2, 0x7f0b0005

    invoke-virtual {p2, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/Button;

    iput-object v2, v1, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter$ViewHolder;->deleteButton:Landroid/widget/Button;

    .line 76
    invoke-virtual {p2, v1}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    .line 81
    :goto_0
    invoke-virtual {p0, p1}, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter;->getItem(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;

    iput-object v2, p0, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter;->carSummary:Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;

    .line 83
    iget-object v2, p0, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter;->carSummary:Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;

    invoke-virtual {v2}, Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;->getImagePath()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/bitauto/autoeasy/tool/ToolBox;->readPicture(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 84
    .local v0, bitmap:Landroid/graphics/Bitmap;
    if-eqz v0, :cond_1

    .line 85
    iget-object v2, v1, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter$ViewHolder;->imageView:Landroid/widget/ImageView;

    invoke-virtual {v2, v0}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    .line 89
    :goto_1
    iget-object v2, v1, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter$ViewHolder;->name:Landroid/widget/TextView;

    iget-object v3, p0, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter;->carSummary:Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;

    invoke-virtual {v3}, Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;->getCarName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 90
    iget-object v2, v1, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter$ViewHolder;->price:Landroid/widget/TextView;

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "\u7ecf\u9500\u5546\u62a5\u4ef7\uff1a"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v4, p0, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter;->carSummary:Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;

    invoke-virtual {v4}, Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;->getRang()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 92
    return-object p2

    .line 78
    .end local v0           #bitmap:Landroid/graphics/Bitmap;
    .end local v1           #holder:Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter$ViewHolder;
    :cond_0
    invoke-virtual {p2}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter$ViewHolder;

    .restart local v1       #holder:Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter$ViewHolder;
    goto :goto_0

    .line 87
    .restart local v0       #bitmap:Landroid/graphics/Bitmap;
    :cond_1
    iget-object v2, v1, Lcom/bitauto/autoeasy/favorite/Adapter/FavCarListAdapter$ViewHolder;->imageView:Landroid/widget/ImageView;

    const v3, 0x7f020008

    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setBackgroundResource(I)V

    goto :goto_1
.end method
